package main

import (
	"fmt"
	"runtime"
	"time"
)

func worker() {
	time.Sleep(10 * time.Second)
}

func main() {
	for i := 0; i < 3; i++ {
		go worker()
	}
	time.Sleep(200 * time.Millisecond)

	// 打印所有 goroutine 快照
	buf := make([]byte, 1<<16)
	n := runtime.Stack(buf, true)
	fmt.Printf("=== 全部 goroutine ===\n%s\n", buf[:n])
}
